import request from '../../utils/request.js'

// 用户收藏的练习
export function listCollectPractice(){
    return request({
        url: '/user/list/collectpracticeIds',
        method: 'get'
    })
}


//取消收藏题目
export function cancelCollectPractice(id) {
    return request({
        url: "user/delete/collectpractice/"+id,
        method: 'delete',
    })
}
// 分页查询题目
export function pageCollectionPractice(data){
    return request({
        url: '/user/list/collectpractice',
        method: 'get',
        params:data
    })
}
// 删除收藏的练习
export function deleteListCollectionPractice(data){
    // console.log(data);
    return request({
        url: '/user/deletelist/collectpractice',
        method: 'delete',
        data: data
    })
}

//获取用户信息
export function getUser(){
    return request({
        url: '/user/get',
        method: 'get'
    })
}


//查询相应的学生
export function listStudent(data){
    return request({
        url: '/user/list/student',
        method: 'get',
        params:data
    })
}

// 获取所有收藏的题目
export function getMyCollectVideo() {
    return request({
        url: '/video/getMyCollectVideo',
        method: 'get',
    })
}

// 获取用户一个月内观看视频的历史记录
export function getVideoHistory() {
    return request({
        url: '/video/getVideoHistory',
        method: 'get',
    })
}

// 获取用户收件箱信息
export function listInbox(data) {
    return request({
        url: '/user/list/inbox',
        method: 'get',
        params:data
    })
}

// 根据综合情况由ai打分及推荐
export function getAiJudgeAndRecommendBySynthesis() {
    return request({
        url: '/aiChat/getAiJudgeAndRecommendBySynthesis',
        method: 'get',
    })
}

// 获取用户本月学习记录
export function getStudyHistory() {
    return request({
        url: '/user/getStudyHistory',
        method: 'get'
    })
}

// 获取用户的练习数据
export function getPracticeDetail() {
    return request({
        url: '/user/getPracticeDetail',
        method: 'get'
    })
}

// 获取用户的视频情况
export function getVideoDetail() {
    return request({
        url: '/user/getVideoDetail',
        method: 'get'
    })
}

// 获取 根据用户练习情况进行总结和推荐 问题的提示词
export function getAiJudgeAndRecommendByPractice() {
    return request({
        url: '/aiChat/getAiJudgeAndRecommendByPractice',
        method: 'get',
    })
}

// 获取 根据用户观看视频情况进行总结和推荐 问题的提示词
export function getAiJudgeAndRecommendByVideo() {
    return request({
        url: '/aiChat/getAiJudgeAndRecommendByVideo',
        method: 'get',
    })
}

// 更新用户身份信息
export function submitRoleInfo(data) {
    return request({
        url: '/user/submitRoleInfo',
        method: 'post',
        data: data
    })
}

// 提交用户反馈
export function submitAdvice(content) {
    return request({
        url: '/user/submitAdvice?content=' + content,
        method: 'post',
    })
}

// 编辑用户信息
export function updateUser(data) {
    return request({
        url: '/user/update',
        method: 'put',
        data: data
    })
}

// 上传头像
export function uploadAvatar(data) {

    return request({
        url: '/user/uploadhead',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}